Fuzz: Display roundtrip - #2528
Conversation
939f006 to
6c5cbe3
Compare
|
@alamb any notes on this one? |
6c5cbe3 to
a30e374
Compare
| use sqlparser::parser::Parser; | ||
|
|
||
| fuzz_target!(|sql: &str| { | ||
| let dialects: [(&str, &dyn Dialect); 14] = [ |
There was a problem hiding this comment.
it might be nice to use a pre-existing dialect enum for this (or add it somewhere) so that newly added dialects automatically get coverage
There was a problem hiding this comment.
For now, I made sure to extend the harnesses and include all of the dialects we are currently cover. I have spent a little while thinking about what could be the cleanest variant going forward but I am not too sure for now. Almost surely, it will be some code we move from the test suites into the lib under a test cfg.
There was a problem hiding this comment.
Maybe just a function in sqlparser like
fn all_dialects() -> Vec<Box<dyn Dialect>>or something 🤔
There was a problem hiding this comment.
We already have such a function in the test suite, that is why I was saying it should be moved from there into the library proper.
38705fa to
a30e374
Compare
Step 3 of #2519, stacked on #2527.
This PR adds the display roundtrip harness for all dialects.
A first 60 seconds run already finds
SELECT [a]]b]inMsSqlDialectrendering asSELECT [a]b], which fails to re-parse. That is the bug class of #2409, already being fixed in #2418, so this harness should help guide that PR..clusterfuzzlite/build.shiterates overcargo fuzz list, so the new target is picked up by the CI builds with no workflow change.